<template>
  <acc-needs-form v-model="form.accNeed" :editable="true" :dates="form.dates"></acc-needs-form>
  <food-needs-form v-model="form.foodNeed" :editable="true"></food-needs-form>
  <classroom-needs-form v-model="form.classroomNeed" :editable="true" :dates="form.dates"></classroom-needs-form>
  <el-row justify="center">
    <el-button type="primary" @click="$emit('next')">下一步</el-button>
    <el-button @click="$emit('back')" plain>返回</el-button>
  </el-row>
  <!--侧边导航栏-->
  <side-nav :titles="titles"></side-nav>
</template>

<script>
import AccNeedsForm from "@/components/AccNeedsForm";
import FoodNeedsForm from "@/components/FoodNeedsForm";
import ClassroomNeedsForm from "@/components/ClassroomNeedsForm";
import sideNav from "@/components/SideNav";

export default {
  name: "second",
  props: ['modelValue'],
  emits:['next','back','update:modelValue'],
  components:{sideNav,AccNeedsForm,FoodNeedsForm,ClassroomNeedsForm},
  data() {
    return {
      titles:['住宿需求','用餐需求','教室需求'],
    }
  },
  methods:{
    initData(){
      this.form.foodNeed.detailList.push({
        type:"早餐",
        people:10,
        times:1,
      },{
        type:"午餐",
        people:10,
        times:1,
      },{
        type:"晚餐",
        people:10,
        times:1,
      });
    }
  },
  computed:{
    form:{
      get() {
        return this.modelValue
      },
      set(value) {
        this.$emit('update:modelValue', value)
      }
    }
  },
  created() {
    this.initData();
  }
}
</script>

<style scoped>

</style>